
$(document).ready(function(){

  //登录内容下拉框
  var gimc1=$('#gimc1');
  var gimc2=$('#gimc2');
  var gimc3=$('#gimc3');
  var gimc4=$('#gimc4');
  var drop_span1=$('#drop_span1');
  var drop_span2=$('#drop_span2');
  var drop_span3=$('#drop_span3');
  var drop_span4=$('#drop_span4');
  var drop_down1=$('#drop_down1');
  var drop_down2=$('#drop_down2');
  var drop_down3=$('#drop_down3');
  var drop_down4=$('#drop_down4');


// 搜索框
  $(".header_search").click(function(){
    $(".search_box").addClass("move");
  });
  $("#search_btn1").click(function(){
    $(".search_box").removeClass("move");
  });

  // 登录框
  $("#message_btn").click(function(){
    $(".login_box").addClass("move2");
  });
  $("#search_btn2").click(function(){
    $(".login_box").removeClass("move2");
  });

  //登录页面
  $("#Quick_Login").click(function(){
    $("#login_page").addClass("move_QKlogin");
  });
  $("#login_back").click(function(){
    $("#login_page").removeClass("move_QKlogin");
  });


//登录内容下拉框
  gimc1.click(function() {
		if (drop_down1.css("display")=="none") {
			drop_down1.css("display","block");
			drop_span1.addClass("arrow_down");
		} else {
			drop_down1.css("display","none");
			drop_span1.removeClass("arrow_down");
		};
  });
  gimc2.click(function() {
		if (drop_down2.css("display")=="none") {
			drop_down2.css("display","block");
			drop_span2.addClass("arrow_down");
		} else {
			drop_down2.css("display","none");
			drop_span2.removeClass("arrow_down");
		};
	});
  gimc3.click(function() {
		if (drop_down3.css("display")=="none") {
        drop_down3.css("display","block");
        drop_span3.addClass("arrow_down");
		} else {
      drop_down3.css("display","none");
      drop_span3.removeClass("arrow_down");
		}; 
  });
  gimc4.click(function() {
		if (drop_down4.css("display")=="none") {
        drop_down4.css("display","block");
        drop_span4.addClass("arrow_down");
		} else {
      drop_down4.css("display","none");
      drop_span4.removeClass("arrow_down");
		}; 
  });

  function check_user(user) {
    var reg = /\w+[@]{1}\w+[.]\w+/;
    var reg2 = /^1[34578]\d{9}$/;
    var user = $("#username_input").val();
    if (!(reg.test(user) || reg2.test(user))){
    // alert("请输入正确的email或手机号");
    $('#user_prompt').css('display','block');
    $("#username_input").focus();
}
else{
  $('#user_prompt').css('display','none');
}
};
$("#denglu").click(function () {
  check_user();
});


});


